import request from '@/utils/request'
const api_name='/teacher'
export default{
    // 获取讲师列表数据
    getList(page,limit,searchObj){
        return request({
            url:`${api_name}/list/${page}/${limit}`,
            method:'post',
            data:searchObj
        })
    },
    // 删除
    deleteById(id){
        return request({
            url:`${api_name}/${id}`,
            method:'delete'
        })
    },
    // 添加
    addTeacher(teacher){
        return request({
            url:`${api_name}`,
            method:'post',
            data:teacher
        })
    },
    // 编辑讲师  根据id获取信息
    teacherEdit(id){
        return request({
            url:`${api_name}/${id}`,
            method:'get'
        })
    },
    // 修改讲师
    updateTeacher(teacher){
        return request({
            url:`${api_name}/${teacher.id}`,
            method:'put',
            data:teacher
        })
    },
    // 获取所有讲师基本信息
    listTeacher(){
        return request({
            url:`${api_name}/list`,
            method:'get'
        })
    }
}